package com.cskaoyan.mapper;

import com.cskaoyan.bean.*;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;
import java.util.List;

public interface RoleMapper {
    long countByExample(RoleExample example);

    int deleteByExample(RoleExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Role record);

    int insertSelective(Role record);

    List<Role> selectByExample(RoleExample example);

    Role selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Role record, @Param("example") RoleExample example);

    int updateByExample(@Param("record") Role record, @Param("example") RoleExample example);

    int updateByPrimaryKeySelective(Role record);

    int updateByPrimaryKey(Role record);

    List<Role> select(@Param("sort") String sort, @Param("order") String order, @Param("name") String name);

    int countAll();

    List<RoleVO> selectAll(String sort, String order);

    List<SystemPermissions> selectPerssionsByRoleId(Integer roleId);

    List<AuthChildren> queryChildrenPermissonsById(String permissionsId);

    List<OptionsChildren> queryOptionChlidrenById(@Param("authChildrenId") String authChildrenId, @Param("permissionsId") String permissionsId);

    ArrayList<String> getPermissionsByRoleId(Integer roleId);

    int updateDeletePermissionsByRoleId(Integer roleId);

    int insertPermissions(@Param("roleId") Integer roleId, @Param("permissions") String[] permissions);

}